package org.geektimes.configuration.microprofile.source;

import java.util.Map;

/**
 * @Author: jipeng
 * @Description: java 加载系统变量
 * @Date: Created in 2021/3/14 14:36
 */
public class JavaSystemPropertiesConfigSource extends MapBesedConfigSource {

    public JavaSystemPropertiesConfigSource(){
        super("Java System properties",400);

    }


    /**
     * Java 系统属性最好通过本地变量保存，使用 Map 保存，尽可能运行期不去调整
     * -Dapplication.name=user-web
     *
     * @return {@link System#getProperties()}
     */
    @Override
    protected void prepareConfigData(Map configData) throws Throwable {
        configData.putAll(System.getProperties());
    }
}
